# -*- coding:utf-8 -*-

"""
isNewHomePageUser -->未登录
"""

from aw import *
from autotest import *

import time


class Test_013(TestCase):
    def setUp(self):
        print("Test_001 setUp")

    def test(self):

        url2 = "https://lcts1.ssjlicai.com/publicws/ws/v1/homePageTags"
        # res = Common.testUrl(url2)
        # Common.validate3Tags(res)

        url1 = "https://lcts1.ssjlicai.com/publicws/ws/v1/isNewHomePageUser?params=%7B%22head%22%3A%7B%22clientId%22%3A%2201%22%2C%22appUDID%22%3A%22androidId-818320cf6bedf039%22%2C%22appVersion%22%3A%2210.7.3.0%22%2C%22channelId%22%3A%22feature%22%2C%22innerMedia%22%3A%22%22%2C%22outerMedia%22%3A%22%22%2C%22subClientId%22%3A%22%22%2C%22origin%22%3A%22%22%7D%2C%22body%22%3A%7B%22ssjName%22%3A%22u_2fw4m%22%2C%22uid%22%3A%22%22%7D%7D"
        # res = Common.testUrl(url1)
        # Common.validateIsNewHomePagerUser(res)



        names = ["杨磊","程天超","邬志鹏","骆露婷","陆小慧","李莉","刘云海",
                 "李志标", "李信慧", "徐雪霞", "徐帆", "叶质熙", "黄凯丽", "周旺",
                 "陈丽梅", "曹磊华","严彩栏","宁晓雯", "李军桃","刘俊",
                 ]



        # 未登录--isNewHomePageUser
        for name in names:
            Common.cleanCache(name)

            ret = Common.searchUserInfo(name)
            if ret:
                res = Common.testUrl(url1,isLogin=False,phoneNumber=ret)
                Common.validateIsNewHomePagerUser(res)


        # 已登录--isNewHomePageUser
        for name in names:
            ret = Common.searchUserInfo(name)
            if ret != "None":
                res = Common.testUrl(url1,isLogin=True,phoneNumber=ret)
                Common.validateIsNewHomePagerUser(res)



        # 登录 -- homePageTags
        for name in names:
            ret = Common.searchUserInfo(name)
            if ret != "None":
                res = Common.testUrl(url2,isLogin=True,phoneNumber=ret)
                Common.validate3Tags(res)

        # 未登录 -- homePageTags
        for name in names:
            ret = Common.searchUserInfo(name)
            if ret != "None":
                res = Common.testUrl(url2,isLogin=False,phoneNumber=ret)
                Common.validate3Tags(res)






    def tearDown(self):
        print("Test_001 tearDown")
